package hw2.cs236369.filtering;

import hw2.cs236369.interfaces.IAuthor;
import hw2.cs236369.interfaces.IDBLP;
import hw2.cs236369.interfaces.IDBLPInfo;

import java.util.Collection;

/**
 * A Filter class, implementing the logic and getting the required data on the authors
 * @author Gal Lalouche
 *
 */
public class Filter {
	private final IDBLP								dblp;
	private final Collection<IAuthor>				filteredAuthors;

	public Filter(final IDBLP dblp) {
		this.dblp = dblp;
		filteredAuthors = dblp.getFilteredAuthors();

	}

	public Collection<IAuthor> getAuthors() {
		return filteredAuthors;
	}

	public IDBLPInfo getInfo(IAuthor author) {
		return new DBLPInfoImpl(author, dblp.getPapers(author));
	}

}
